<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        //a=b&c=d 来一个方法转化成下边得 {a:b,c:d}
        let cc = 'a=b&c=d'
        function getObj(e,obj={}){
            let dd = e.split('&')
            for(let item of dd) {
                obj[item.split('=')[0]]=item.split('=')[1]
            }
            return obj
        }
       console.log(getObj(cc))
    </script>
</body>
</html>